package com.xon.lotp.service.Impl;

import com.xon.lotp.mapper.GroupMapper;
import com.xon.lotp.pojo.Group;
import com.xon.lotp.service.GroupService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class GroupServiceImpl implements GroupService {

    @Autowired
    GroupMapper groupMapper;

    public List<Group> viewAllGroups(String projectId) {
        return groupMapper.viewAllGroupsByProjectId(projectId);
    }

    public List<Group> showMyGroups(String userId) {
        List<Group> result = groupMapper.viewGroupsByUserId(userId);
        return result;
    }
}
